package ma.ac.onousc.gestionfi.EngagementPaiement.model.DAO.DAOBean;

import java.util.List;

import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;

import ma.ac.onousc.gestionfi.EngagementPaiement.model.Engagement;
import ma.ac.onousc.gestionfi.EngagementPaiement.model.DAO.EngagementDAO;
import ma.ac.onousc.gestionfi.budget.model.RubriqueBudgetaire;
import ma.ac.onousc.gestionfi.budget.model.DAO.DAOBean.GenericEJB3Bean;

@Stateless
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public class EngagementDAOBean extends GenericEJB3Bean<Engagement, Integer>
		implements EngagementDAO {

	@SuppressWarnings("unchecked")
	@Override
	public List<Engagement> findByRB(RubriqueBudgetaire rb) {

		return this.getEntityManager().createNamedQuery("Engagement.findByRB")
				.setParameter("rb", rb).getResultList();
	}

}